﻿using Proto;

namespace sgf.server
{
    public static class PIDUtil
    {
        //Send
        public static void Send(this PID pid, object message, PID? sendPid = null)
        {
            ActorCore.Send(pid, message, sendPid);
        }

        //SendAsync
        public static async Task<TV> SendAsync<T, TV>(this PID pid, T message,
            CancellationToken cancellationToken = new()) where T : IRequestMsg where TV : IResponseMsg
        {
            return await ActorCore.SendAsync<T, TV>(pid, message, cancellationToken);
        }
    }
}